export const ID = "SET_MP3_BY_ID";

export function initMP3ByID(state?: boolean) {
	if (state) {
		window.localStorage.setItem(ID, String(state));
		return state;
	}

	const defaultState = true;
	const api = Boolean(window.localStorage.getItem(ID));

	if (api === null) {
		window.localStorage.setItem(ID, String(defaultState));
		return defaultState;
	}

	return api;
}
